3.673 \(\int (a+b \sin (e+f x)) (c+d \sin (e+f x)) \, dx\)

Optimal. Leaf size=53 \[ -\frac {(a d+b c) \cos (e+f x)}{f}+\frac {1}{2} x (2 a c+b d)-\frac {b d \sin (e+f x) \cos (e+f x)}{2 f} \]

[Out]

1/2*(2*a*c+b*d)*x-(a*d+b*c)*cos(f*x+e)/f-1/2*b*d*cos(f*x+e)*sin(f*x+e)/f

________________________________________________________________________________________

Rubi [A]  time = 0.02, antiderivative size = 53, normalized size of antiderivative = 1.00, number of steps used = 1, number of rules used = 1, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.048, Rules used = {2734} \[ -\frac {(a d+b c) \cos (e+f x)}{f}+\frac {1}{2} x (2 a c+b d)-\frac {b d \sin (e+f x) \cos (e+f x)}{2 f} \]

Antiderivative was successfully verified.

[In]

Int[(a + b*Sin[e + f*x])*(c + d*Sin[e + f*x]),x]

[Out]

((2*a*c + b*d)*x)/2 - ((b*c + a*d)*Cos[e + f*x])/f - (b*d*Cos[e + f*x]*Sin[e + f*x])/(2*f)

Rule 2734

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[((2*a*c
+ b*d)*x)/2, x] + (-Simp[((b*c + a*d)*Cos[e + f*x])/f, x] - Simp[(b*d*Cos[e + f*x]*Sin[e + f*x])/(2*f), x]) /;
 FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0]

Rubi steps

\begin {align*} \int (a+b \sin (e+f x)) (c+d \sin (e+f x)) \, dx &=\frac {1}{2} (2 a c+b d) x-\frac {(b c+a d) \cos (e+f x)}{f}-\frac {b d \cos (e+f x) \sin (e+f x)}{2 f}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.09, size = 52, normalized size = 0.98 \[ \frac {-4 (a d+b c) \cos (e+f x)+4 a c f x-b d \sin (2 (e+f x))+2 b d e+2 b d f x}{4 f} \]

Antiderivative was successfully verified.

[In]

Integrate[(a + b*Sin[e + f*x])*(c + d*Sin[e + f*x]),x]

[Out]

(2*b*d*e + 4*a*c*f*x + 2*b*d*f*x - 4*(b*c + a*d)*Cos[e + f*x] - b*d*Sin[2*(e + f*x)])/(4*f)

________________________________________________________________________________________

fricas [A]  time = 0.44, size = 48, normalized size = 0.91 \[ -\frac {b d \cos \left (f x + e\right ) \sin \left (f x + e\right ) - {\left (2 \, a c + b d\right )} f x + 2 \, {\left (b c + a d\right )} \cos \left (f x + e\right )}{2 \, f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sin(f*x+e))*(c+d*sin(f*x+e)),x, algorithm="fricas")

[Out]

-1/2*(b*d*cos(f*x + e)*sin(f*x + e) - (2*a*c + b*d)*f*x + 2*(b*c + a*d)*cos(f*x + e))/f

________________________________________________________________________________________

giac [A]  time = 0.82, size = 48, normalized size = 0.91 \[ \frac {1}{2} \, {\left (2 \, a c + b d\right )} x - \frac {b d \sin \left (2 \, f x + 2 \, e\right )}{4 \, f} - \frac {{\left (b c + a d\right )} \cos \left (f x + e\right )}{f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sin(f*x+e))*(c+d*sin(f*x+e)),x, algorithm="giac")

[Out]

1/2*(2*a*c + b*d)*x - 1/4*b*d*sin(2*f*x + 2*e)/f - (b*c + a*d)*cos(f*x + e)/f

________________________________________________________________________________________

maple [A]  time = 0.09, size = 59, normalized size = 1.11 \[ \frac {b d \left (-\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )-d a \cos \left (f x +e \right )-c b \cos \left (f x +e \right )+a c \left (f x +e \right )}{f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+b*sin(f*x+e))*(c+d*sin(f*x+e)),x)

[Out]

1/f*(b*d*(-1/2*sin(f*x+e)*cos(f*x+e)+1/2*f*x+1/2*e)-d*a*cos(f*x+e)-c*b*cos(f*x+e)+a*c*(f*x+e))

________________________________________________________________________________________

maxima [A]  time = 0.67, size = 57, normalized size = 1.08 \[ \frac {4 \, {\left (f x + e\right )} a c + {\left (2 \, f x + 2 \, e - \sin \left (2 \, f x + 2 \, e\right )\right )} b d - 4 \, b c \cos \left (f x + e\right ) - 4 \, a d \cos \left (f x + e\right )}{4 \, f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sin(f*x+e))*(c+d*sin(f*x+e)),x, algorithm="maxima")

[Out]

1/4*(4*(f*x + e)*a*c + (2*f*x + 2*e - sin(2*f*x + 2*e))*b*d - 4*b*c*cos(f*x + e) - 4*a*d*cos(f*x + e))/f

________________________________________________________________________________________

mupad [B]  time = 7.72, size = 52, normalized size = 0.98 \[ a\,c\,x+\frac {b\,d\,x}{2}-\frac {a\,d\,\cos \left (e+f\,x\right )}{f}-\frac {b\,c\,\cos \left (e+f\,x\right )}{f}-\frac {b\,d\,\sin \left (2\,e+2\,f\,x\right )}{4\,f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + b*sin(e + f*x))*(c + d*sin(e + f*x)),x)

[Out]

a*c*x + (b*d*x)/2 - (a*d*cos(e + f*x))/f - (b*c*cos(e + f*x))/f - (b*d*sin(2*e + 2*f*x))/(4*f)

________________________________________________________________________________________

sympy [A]  time = 0.32, size = 94, normalized size = 1.77 \[ \begin {cases} a c x - \frac {a d \cos {\left (e + f x \right )}}{f} - \frac {b c \cos {\left (e + f x \right )}}{f} + \frac {b d x \sin ^{2}{\left (e + f x \right )}}{2} + \frac {b d x \cos ^{2}{\left (e + f x \right )}}{2} - \frac {b d \sin {\left (e + f x \right )} \cos {\left (e + f x \right )}}{2 f} & \text {for}\: f \neq 0 \\x \left (a + b \sin {\relax (e )}\right ) \left (c + d \sin {\relax (e )}\right ) & \text {otherwise} \end {cases} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sin(f*x+e))*(c+d*sin(f*x+e)),x)

[Out]

Piecewise((a*c*x - a*d*cos(e + f*x)/f - b*c*cos(e + f*x)/f + b*d*x*sin(e + f*x)**2/2 + b*d*x*cos(e + f*x)**2/2
 - b*d*sin(e + f*x)*cos(e + f*x)/(2*f), Ne(f, 0)), (x*(a + b*sin(e))*(c + d*sin(e)), True))

________________________________________________________________________________________